package com.pg.controller.rz;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pg.entity.rz.EipDataDetailedInfo;
import com.pg.service.EipDataDetailedInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
/**
 * <p>
 * 日志详情前端控制器
 * </p>
 *
 * @author likl
 * @since 2020-07-06
 */
@Api(tags = "日志详情")
@RestController
@RequestMapping("/eipDataDetailedInfo")
public class EipDataDetailedInfoController extends JeecgController<EipDataDetailedInfo, EipDataDetailedInfoService> {

    @Autowired
    private EipDataDetailedInfoService eipDataDetailedInfoService;

    /**
     * 分页列表查询 日志详情
     *
     * @param eipDataDetailedInfo 日志详情
     * @param operationStartDate  起始时间
     * @param operationEndDate    结束时间
     * @param pageNo              起始页
     * @param pageSize            每页条数
     * @param req                 参数
     * @return 分页数据
     */
    @ApiOperation("分页列表查询 日志详情")
    @AutoLog(value = "LogManagement")
    @RequestMapping(method = RequestMethod.GET, value = "/selectForList")
    public Result<?> selectForList(
            EipDataDetailedInfo eipDataDetailedInfo,
            @RequestParam(name = "operationStartDate", defaultValue = "") @DateTimeFormat(pattern = "yyyy-MM-dd") Date operationStartDate,
            @RequestParam(name = "operationEndDate", defaultValue = "") @DateTimeFormat(pattern = "yyyy-MM-dd") Date operationEndDate,
            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
            HttpServletRequest req) {
        Page<EipDataDetailedInfo> page = new Page<EipDataDetailedInfo>(pageNo, pageSize);
        page.setRecords(eipDataDetailedInfoService.selectForList(page, eipDataDetailedInfo, operationStartDate, operationEndDate));
        return Result.ok(page);
    }
}
